home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / MasterVolume.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  2.2 KB  |  85 lines

  1. 'FMA Script Framework Plugin
  2. 'MasterVolume
  3. 'Let's you change the master volume of your soundcard
  4.  
  5. 'TODO:
  6. '-nothing atm.
  7. '-maybe react on the event MusicMute
  8.  
  9. Class MasterVolume
  10.     
  11.     Private m_Self
  12.     Private mainMenu
  13.     
  14.     'Some info about the plugin
  15.     Public Property Get SHOWABLE 'Do I have a menu?
  16.         SHOWABLE    = True
  17.     End Property
  18.     Public Property Get TITLE 'What's my name?
  19.         TITLE       = "Master Volume"
  20.     End Property
  21.     Public Property Get DESCRIPTION 'What's my purpose?
  22.         DESCRIPTION = "Let's you change the master volume of your soundcard"
  23.     End Property
  24.     Public Property Get AUTHOR 'Who created me?
  25.         AUTHOR      = "streawkceur (inspired by ultimatex)"
  26.     End Property
  27.     Public Property Get URL 'Were can I be found? Where can you get more information?
  28.         URL = "http://fma.xinium.com/"
  29.     End Property
  30.     
  31.     'Who am I?
  32.     Public Property Let Self (s)
  33.         m_Self = s
  34.         'Create managed menu object
  35.         Set mainMenu = New ManagedMenu
  36.     End Property
  37.     Public Property Get Self
  38.         Self = m_Self
  39.     End Property
  40.     
  41.     'Display me.
  42.     Sub Show()
  43.         'Note that you MUST do an am.Upate EVERYRTIME your menu command was executed
  44.         
  45.         'Init Menu LList
  46.         Dim llist, bi
  47.         Set llist = New LinkedList
  48.         bi = llist.BackInserter
  49.         bi.Item = Array("Set Volume", Self & ".VolumeSet")
  50.         If ActiveXManager("floAtMediaCtrl.VolumeCtrl").mute = 0 Then
  51.             bi.Item = Array("Mute", Self & ".VolumeMute")
  52.         Else
  53.             bi.Item = Array("Unmute",  Self & ".VolumeMute")
  54.         End If
  55.         
  56.         'Set title
  57.         If ActiveXManager("floAtMediaCtrl.VolumeCtrl").Mute = 0 Then
  58.             mainMenu.Title = "Volume (" & ActiveXManager("floAtMediaCtrl.VolumeCtrl").Volume & "%)"
  59.         Else
  60.             mainMenu.Title = "Volume (M)"
  61.         End If
  62.         
  63.         'Set list and show
  64.         mainMenu.SetList llist
  65.         mainMenu.ShowMenu
  66.     End Sub
  67.     
  68.     Sub VolumeSet()
  69.         am.Back = Self & ".Show"
  70.         am.DlgPercent "Volume", Self & ".VolumeSetEvent", 10, ActiveXManager("floAtMediaCtrl.VolumeCtrl").Volume/10
  71.     End Sub
  72.     
  73.     Sub VolumeSetEvent( value, final )
  74.         ActiveXManager("floAtMediaCtrl.VolumeCtrl").Volume = value
  75.         If final = 1 Then Show
  76.     End Sub
  77.     
  78.     Sub VolumeMute()
  79.         ActiveXManager("floAtMediaCtrl.VolumeCtrl").mute = (ActiveXManager("floAtMediaCtrl.VolumeCtrl").mute + 1) Mod 2
  80.         Show
  81.     End Sub
  82.  
  83. End Class
  84.  
  85.